@extends('layouts.app')

@section('content')
        <div class="header">
            <ul class="breadcrumb">
                <li>个人中心</li>
                <li><a href="">修改密码</a> </li>
            </ul>
        </div>
        <div class="main-content">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#home" data-toggle="tab">修改密码</a></li>
            </ul>

            <div class="rows">
                <div class="col-md-12 col-sm-12">
                    <br>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane active in" id="home">
                            <form id="tab" class="form-horizontal" method="post" enctype="multipart/form-data">
                                <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                <div class="form-group">
                                    <label for="input1" class="pull-left control-label" style="width:120px;">用户名</label>
                                    <div class="col-sm-6">
                                        <input type="text" class="form-control" value="{{$userinfo->email}}" disabled>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input2" class="pull-left w120 control-label">原密码</label>
                                    <div class="col-sm-6">
                                        <input type="password" class="form-control" name="oldpassword" placeholder="原密码" value="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input2" class="pull-left w120 control-label">新密码</label>
                                    <div class="col-sm-6">
                                        <input type="password" class="form-control" name="newpassword" placeholder="新密码" value="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="input2" class="pull-left w120 control-label">确认密码</label>
                                    <div class="col-sm-6">
                                        <input type="password" class="form-control" name="newpassword2" placeholder="确认密码" value="">
                                    </div>
                                </div>

                                <div class="btn-toolbar list-toolbar btn-toolbar2">
                                    <button class="btn btn-primary">确定</button>
                                    <a href="javascript:history.back(-1);" class="btn btn-back">返回</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <script type="text/javascript">
            $(document).on("change",'#city', function(){
                $('#area option:gt(0)').remove();
                $('#org_id option:gt(0)').remove();
                //alert(1);die;
                var cid = $("#city").val();
                var url = "{{url('admin/getArea')}}";
                $.getJSON(url,{cid:cid},function(json){
                    /*清空原有的选项*/
                    if(json != ''){
                        $.each(json,function(index,array){
                            var option = "<option value='"+array['id']+"'";
                            option += ">"+array['name']+"</option>";
                            $("#area").append(option);
                        });
                    }
                });
            });

            $(document).on("change",'#area', function(){
                $('#org_id option:gt(0)').remove();
                var cid = $("#area").val();
                var url = "{{url('admin/getArea')}}";
                $.getJSON(url,{cid:cid},function(json){
                    /*清空原有的选项*/
                    if(json != ''){
                        $.each(json,function(index,array){
                            var option = "<option value='"+array['id']+"'";
                            option += ">"+array['name']+"</option>";
                            $("#org_id").append(option);
                        });
                    }
                });
            });
        </script>
@stop